<template>
  <div>
      <f-search-form :more="true" @searchHandler="searchHandler" :tableObj="tableObj" :show-export-btn='true' export-url='exportUrl2'>
        <f-search-form-item label="账套"  name="areaName"   type="select"      valueKey="areaName" label-key="areaName" style="width:220px"/>
        <f-search-form-item label="商品名称" ref="dept"  name="deptId" type="select"   valueKey="deptId" label-key="deptName" style="width:220px"/>
        <f-search-form-item label="统计日期" name="orderNo" style="width: 250px"/>
      </f-search-form>
      <f-table ref="table"  rowKey="orderDetailsId" :showSetting="true"  :tableColumns="columns" :scroll="{x:true}"  :multiple="false" :operator="operator" :params="queryParam" :api="api.bod" handler="orderDetailsReportHandler">
      </f-table>

  </div>
</template>
<script>
  import api from './../../js/api'

  export default {
    name: 'InventoryList',
    components: {
      
    },
    data() {
      let me = this
      //操作按钮
      let operator = []
      let customFlag=this.$store.state.user.customFlag
      return {
        api: Object.assign(api, this.api),
        //列表初始化查询参数
        queryParam: {
          companyId:this.$store.state.user.companyId
        },
        tableObj:null,
        superAdmin: this.superAdmin,
        // 表头
        columns: [
          {
            title: '序号',
            width: '70px',
            align: 'center',
            customRender: (text, record, index) => index + 1
          },
          {
            title: '姓名',
            align: 'left',
            width: '130px',
            dataIndex: 'orderNo',
            scopedSlots: { customRender: 'orderNo' }
          },
          {
            title: '岗位',
            align: 'left',
            width: '80px',
            dataIndex: 'saleType'
          },
          {
            title: '5月30日',
            align: 'left',
            width: '90px',
            children:[
              {
                title: '发货笔数',
                align: 'left',
                width: '80px',
                dataIndex: 'saleType'
              },  {
                title: '结算笔数',
                align: 'left',
                width: '80px',
                dataIndex: 'saleType'
              },  {
                title: '售后笔数',
                align: 'left',
                width: '80px',
                dataIndex: 'saleType'
              },  {
                title: '复核笔数',
                align: 'left',
                width: '80px',
                dataIndex: 'saleType'
              },
            ]
          },
          {
            title: '5月31日',
            align: 'left',
            width: '90px',
            children:[
              {
                title: '发货笔数',
                align: 'left',
                width: '80px',
                dataIndex: 'saleType'
              },  {
                title: '结算笔数',
                align: 'left',
                width: '80px',
                dataIndex: 'saleType'
              },  {
                title: '售后笔数',
                align: 'left',
                width: '80px',
                dataIndex: 'saleType'
              },  {
                title: '复核笔数',
                align: 'left',
                width: '80px',
                dataIndex: 'saleType'
              },
            ]
          },
        ],
        operator: operator
      }
    },
    created() {
    },
    mounted() {
      this.tableObj=this.$refs.table
    },
    methods: {
      onCopy() {
        this.$message.success('复制成功!')
      },
      initSettle(record){
        this.http.confirm(this, {
          content: '确认初始化结算吗?',
          url: api.payment.initSettlePayment,
          data: {
            orderDetailsId: record.orderDetailsId
          }
        })
      },
      clearExport(){
        this.http.post(this, {
          url: this.api.bod.clearExportData
        })
      }
    }
  }
</script>
